#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_2_clicked()
{
    qDebug() << "Up按钮槽函数执行!";

    QRect rect = ui->pushButton->geometry();
    ui->pushButton->setGeometry(rect.x(), rect.y()-5, rect.width(), rect.height());
}

void Widget::on_pushButton_3_clicked()
{
    qDebug() << "Right按钮槽函数执行!";
    QRect rect = ui->pushButton->geometry();
    ui->pushButton->setGeometry(rect.x()+5, rect.y(), rect.width(), rect.height());
}

void Widget::on_pushButton_5_clicked()
{
    qDebug() << "Left按钮槽函数执行!";
    QRect rect = ui->pushButton->geometry();
    ui->pushButton->setGeometry(rect.x()-5, rect.y(), rect.width(), rect.height());
}

void Widget::on_pushButton_4_clicked()
{
    qDebug() << "Down按钮槽函数执行!";
    QRect rect = ui->pushButton->geometry();
    ui->pushButton->setGeometry(rect.x(), rect.y()+5, rect.width(), rect.height());
}
